
#include "h.hpp"
#include "rpc.hpp"
#include <fstream>
#include "execManager.hpp"
#include "mock.hpp"

#include "net/pure-weakAsyncHttpServer.hpp"

#include <filesystem>
namespace filesystem = std::filesystem;
using std::filesystem::path;
using std::filesystem::current_path;

using namespace weak;

BOOST_AUTO_TEST_CASE(test_get_txs_count){
  mockedAcnPrv::F2 wh;           // the in-RAM rocksDB
  BOOST_REQUIRE(wh.setInChainDB("/tx/1", "1"));
  BOOST_REQUIRE(wh.setInChainDB("/tx/2", "1"));
  BOOST_REQUIRE(wh.setInChainDB("/tx/3", "1"));
  // 5.
  IChainDBGettable2 * w = dynamic_cast<IChainDBGettable2*>(&wh);
  BOOST_CHECK_EQUAL(3, Rpc::get_txs_count(w));
}
